package com.typhoon.spring_shiro.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.typhoon.spring_shiro.dao.PermissionDao;
import com.typhoon.spring_shiro.dto.PermissionDto;
import com.typhoon.spring_shiro.dto.RoleDto;
import com.typhoon.spring_shiro.entity.Permission;
import com.typhoon.spring_shiro.service.PermissionService;
import com.typhoon.spring_shiro.utils.CollectionUtils;

@Service("permissionService")
public class PermissionServiceImpl implements PermissionService {

	private static final Logger logger = LoggerFactory.getLogger(PermissionServiceImpl.class);
	
	@Resource
	private PermissionDao permissionDao;
	
	@Override
	public int save(PermissionDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int saveBatch(List<? extends PermissionDto> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(PermissionDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateBatch(List<PermissionDto> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteByPK(Long paramK) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatchByPK(List<Long> paramList) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(PermissionDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatch(PermissionDto paramE) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PermissionDto get(Object paramObject) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<PermissionDto> list(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<PermissionDto> list(Object paramObject) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long count(Map<String, Object> paramMap) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public long count(Object paramObject) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public PermissionDto queryByPK(Long paramK) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<PermissionDto> listAllPermission(List<RoleDto> roles) {
		if(null == roles || roles.isEmpty())
			return null;
		List<Permission> permissions = this.permissionDao.listAllPermission(roles);
		if(null == permissions || permissions.isEmpty())
			return null;
		return CollectionUtils.transform(permissions, PermissionDto.class);
	}

}
